package masterjava.test;


import masterjava.common.configuration.AppSetting;
import masterjava.common.context.AppContext;
import masterjava.common.logging.LoggingLevel;
import masterjava.common.logging.MasterLogger;

/**
 * User: GKislin
 * Date: 13.03.2009
 * <p/>
 * JUnit context
 * JUnitContext.init() must be called in every JUnit
 */
public class JUnitContext extends AppContext {

    static {
        MasterLogger.reset();
    }

    protected static void init() {
        new JUnitContext();
        AppSetting.get().LOGGING_LEVEL.set(LoggingLevel.DEBUG);
        LOGGER.info("\n\n++++++++++++  INIT JUNIT APPLICATION TEST ++++++++++++");
    }

//    @Override
//    public void registerMBean(IStateBean item, String name) {
//        System.out.println("Register MBean " + item.getKey() + " with ObjectName '" + name + "'");
//    }
//
//    @Override
//    public void unregisterMBean(IStateBean item, String name) {
//        System.out.println("Unregister MBean " + item.getKey() + " with ObjectName '" + name + "'");
//    }
//
//    @Override
//    public DataSource getDataSource(Scheme schema) throws SQLException {
//        System.out.println("Get dataSource with URL " + url);
//        OracleDataSource dataSource = new OracleDataSource();
//        dataSource.setURL(url);
//        return dataSource;
//    }
}
